package com.zz.mybatis.session.defaults;

import com.zz.mybatis.binding.MapperRegistry;
import com.zz.mybatis.session.SqlSession;
import com.zz.mybatis.session.SqlSessionFactory;

/**
 * @author ZHOUZHEN
 * @date 2023/7/7
 */

public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private MapperRegistry mapperRegistry;

    public DefaultSqlSessionFactory(MapperRegistry mapperRegistry) {
        this.mapperRegistry = mapperRegistry;
    }


    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(mapperRegistry);
    }
}
